#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
    int a, b, n, c;
    while (scanf("%d", &n) != EOF)
    {
        for (int a = 0; a < n; a++)
        {
            if (a == 0 || a == n - 1)
            {
                for (int b = 0; b < n; b++)
                {
                    printf("* ");
                }
            }
            else
            {
                for (int c = 0; c < 2 * n; c++)
                {
                    if (c == 0 || c == 2 * n - 2)
                        printf("*");
                    else
                        printf(" ");
                }
            }
            printf("\n");
        }
    }
    return 0;
}